<?php
/**
 * Author   : 葫芦瓢子 <gourdladle@163.com>
 * Date     : 2023-06-03
 * Wechat   : skymouses
 * License  : MIT
 */

$db = \think\facade\Config::get('database');
$dbCfg = $db['connections'][$db['default']];
$rootPath = root_path();

return
[
    'paths' => [
        'migrations' => $rootPath.'/db/migrations',
        'seeds' => $rootPath.'/db/seeds'
    ],
    'environments' => [
        'default_migration_table' => 'phinxlog',
        'default_environment' => 'using',
        'using' => [
            'adapter' => $dbCfg['type'],
            'host' => $dbCfg['hostname'],
            'name' => $dbCfg['database'],
            'user' => $dbCfg['username'],
            'pass' => $dbCfg['password'],
            'port' => $dbCfg['hostport'],
            'charset' => $dbCfg['charset'],
            'table_prefix' => $dbCfg['prefix'],
        ],
    ],
    'version_order' => 'creation'
];
